package com.zx._09_架构.重构.案例;

/**
 * @program: knowledge
 * @description:
 * @author: xue.zhang
 * @create: 2021-11-17 11:18
 */
public class CoverageDemo {

    public static int cal(int type, int a) {
        if (type == 1) {
            a = Math.abs(a) - 1;
            if (a != 0) {
                a = cal(type, a);
            }
        } else if (type == 2) {
            a = 2;
        }
        return a;
    }

    public static int add(int a, int b) {
        return a + b;
    }

    public static void main(String[] args) {
        System.out.println(CoverageDemo.cal(1, 10));
    }

}
